package com.vcredit.creditcat.enumtype.product.sd;

/**
 * 闪贷月收入枚举
 * @author zhaoqi01
 *
 */
public enum SDSalaryEnum {
	
	BELOW_1K(1, 1, "1000以下"), K1_2(2, 1, "1000-2000"), K2_4(3, 2, "2000-4000"),
    K4_6(4, 3, "4000-6000"), K6_8(5, 3, "6000-8000"), K8_10(6, 4, "8000-10000"), 
    K10_12(7, 4, "10000-12000"), K12_15(8, 5, "12000-15000"), K15_20(9, 6, "15000-20000"),
    ABOVE_20K(10, 7, "20k以上");

    private Integer scode; // 信用猫的收入code
    private Integer tcode; // 闪贷的收入code
    private String desc;

    private SDSalaryEnum(Integer scode, Integer tcode, String desc) {
        this.scode = scode;
        this.tcode = tcode;
        this.desc = desc;
    }

    public Integer getScode() {
		return scode;
	}


	public String getDesc() {
        return desc;
    }

	public Integer getTcode() {
		return tcode;
	}
    
	public static Integer getTcodeByScode(Integer scode) {
		SDSalaryEnum[] enums = SDSalaryEnum.values();
		for (SDSalaryEnum sdSalaryEnum : enums) {
			if(sdSalaryEnum.getScode().intValue() == scode) {
				return sdSalaryEnum.getTcode();
			}
		}
		return 1;
	}
}
